<template>
	<view style="display: flex;align-items: center;flex-direction: column;">
		<!-- <view class="success-icon">
			<view class="hook">

			</view>
		</view> -->
		<view class="success-icon">
			<image src="../static/success.png"></image>
			<!-- <view class="hook">
				
			</view> -->
		</view>
		<view class="">
			提交成功
		</view>
		<view class="btn-box">
			<button type="default" class="btn btn-submit" @click="goBack">{{title}}</button>
			<button type="default" class="btn btn-submit" @click="goHome">返回首页</button>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				path: '',
				title: '',
				id: null
			}
		},
		onLoad(options) {
			this.path = options.path
			this.title = options.title
			this.id = +options.id
		},
		methods: {
			goHome() {
				uni.switchTab({
					url: '/pages/index/index'
				})
			},
			goBack() {
				if(this.id) {
					uni.reLaunch({
						url: this.path + '?id='  +  this.id
					})
					return
				}
				uni.reLaunch({
					url: this.path
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.btn-box {
		margin-right: 100rpx;
		display: flex;
	}
	.btn {
		width: 280rpx;
	}
	.success-icon {
		margin: 70rpx;
		margin-top: 120rpx;
		width: 260rpx;
		height: 260rpx;
		border-radius: 50%;
		// background-color: #4CD964;
		display: flex;
		justify-content: center;
		align-items: center;
		image {
			width: 100%;
			height: 100%;
		}
	}
	
	.home-btn {
		margin-top: 80rpx;
		width: 568rpx;
		height: 80rpx;
		line-height: 80rpx;
		border-radius: 8rpx;
		// margin: 0 auto;
		font-size: 28rpx;
		font-family: Noto Sans S Chinese;
		font-weight: normal;
		color: #636363;
		background: $theme-color;
		color: #FFFFFF;
	}
</style>
